import { Component, NgModule } from '@angular/core';
import { Platform, NavController } from 'ionic-angular';
import { BrowserModule } from '@angular/platform-browser';



import { engineersdetailPage } from '../engineersdetail/engineersdetail';//工程详细页
import { PubApi } from '../../providers/pubapi';
//import {BrowserModule} from '@angular/platform-borwser';



declare var $;

@Component({
    selector: 'page-engineers',


    templateUrl: 'engineers.html'
})

@NgModule({

    imports: [
        BrowserModule,     
    ]
})


export class EngineersPage {
    public bb: "cc";
    // items:any = [
    //     "Pokémon Yellow":[aa:"aa"],
    //     'Super Metroid':["bb":"bb"]

    // ];
    items: any = [
    ];
    // {
    //         "Name": "长江",
    //         items: [{ "Name": "长江崇明段" }, { "Name": "长江安徽段" }]

    //     },
    //     {
    //         "Name": "黄河",
    //         items: [{ "Name": "黄河山东段" }, { "Name": "黄河山西段" }]

    //     }
    constructor(public platform: Platform, public navCtrl: NavController, public pubapi: PubApi) {

        platform.ready().then(() => {









        });

    }


    ionViewDidEnter() {
        var that = this;
        this.pubapi.get("/EngineerCreate/MobileQuery", function (res) {
            var result = res.data;
            that.items = result;

        })

    }

    showBox(self) {
        
        if ($(self.target).parent().find(".Js_sonItem").is(":hidden")) {
           $(self.target).parent().find(".Js_sonItem").show();
            //如果元素为隐藏,则将它显现
        } else {
           $(self.target).parent().find(".Js_sonItem").hide();
            //如果元素为显现,则将其隐藏
        }


    }

    itemSelectedengineers(item) {
        this.navCtrl.push(engineersdetailPage, {
            engineer: item
        });

    }
}
